{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "a1195e67",
   "metadata": {},
   "source": [
    "#### Range 试验:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "260aee12",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": "range(0, 5)"
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "range(5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "b22b9944",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": "[0, 1, 2, 3, 4]"
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "list(range(5))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "30388d89",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": "[5, 6, 7, 8, 9]"
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "list(range(5,10))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "e66a3ab9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": "[0, 2, 4, 6, 8]"
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "list(range(0,10,2))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "e699289b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": "[10, 8, 6, 4, 2]"
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "list(range(10,0,-2))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "ef5ea627",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": "[]"
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "list(range(10,0,2))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a5d039c0",
   "metadata": {},
   "source": [
    "#### 此时START值大于STOP值，而STEP为正值，会得到一个空列表"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "f9e5b821",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": "[99,\n 98,\n 97,\n 96,\n 95,\n 94,\n 93,\n 92,\n 91,\n 90,\n 89,\n 88,\n 87,\n 86,\n 85,\n 84,\n 83,\n 82,\n 81,\n 80,\n 79,\n 78,\n 77,\n 76,\n 75,\n 74,\n 73,\n 72,\n 71,\n 70,\n 69,\n 68,\n 67,\n 66,\n 65,\n 64,\n 63,\n 62,\n 61,\n 60,\n 59,\n 58,\n 57,\n 56,\n 55,\n 54,\n 53,\n 52,\n 51,\n 50,\n 49,\n 48,\n 47,\n 46,\n 45,\n 44,\n 43,\n 42,\n 41,\n 40,\n 39,\n 38,\n 37,\n 36,\n 35,\n 34,\n 33,\n 32,\n 31,\n 30,\n 29,\n 28,\n 27,\n 26,\n 25,\n 24,\n 23,\n 22,\n 21,\n 20,\n 19,\n 18,\n 17,\n 16,\n 15,\n 14,\n 13,\n 12,\n 11,\n 10,\n 9,\n 8,\n 7,\n 6,\n 5,\n 4,\n 3,\n 2,\n 1]"
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "list(range(99,0,-1))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "3e4f7649",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}